package cn.jingyinghui.testlambda;

import java.util.ArrayList;
import java.util.List;

public class GenenalUtils {

    public static <T> List<T> doFilter(List<T> list, Filter<T> filter){
        List<T> result = new ArrayList<>();
        for(T t:list){
            if(filter.test(t)){
                result.add(t);
            }
        }
        return result;
    }

    public static void doRunnable(Runnable r){
        r.run();
    }

}
